<?

$indexes = array (
	title=>array (label=>"Title",order=>"DEFAULT",wrapper=>"vmc_icon_assignment",callback=>"_template_list_substring",length=>26),
	assigning_user=>array (label=>"Designating User",order=>"DEFAULT",wrapper=>"vmc_icon_user"),
	status=>array (label=>"Status",order=>"DEFAULT",
			values=>array (
				"assign"=>"Assign",
				"accept"=>"Accept",
				"reject"=>"Reject",
				"forward"=>"Forward",
			)),
	cdate=>array (label=>"Assigned Date",order=>"DEFAULT",wrapper=>"vmc_icon_date"),
	task_id=>array (label=>"Assignment",order=>"DEFAULT",callback=>"_app_task_options"),
);

function _app_task_options ($container) {

	$task_id = $container->get_variable ("row")->task_id;
	$assignment_id = $container->get_variable ("row")->id;

	print <<<HTML
<td class="vmc_list_control_column_a vmc_list_button" align="center" width="235px">
	<div class="vmc_list_option_div"><form action="/admin/projects/projects/fs_projects.php?fs_tab=tasks&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_tasks&fs_action=view&fs_tab_tasks=assignment&task_id={$task_id}&assignment_id={$assignment_id}&fs_action_assignment=addnew&fs_tab_option_tasks=fs_assignment&pta_status=accept" method="POST"><input type="submit" class="vmc_list_option vmc_button_accept" value="Accept"></form></div>
	<div class="vmc_list_option_div"><form action="/admin/projects/projects/fs_projects.php?fs_tab=tasks&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_tasks&fs_action=view&fs_tab_tasks=assignment&task_id={$task_id}&assignment_id={$assignment_id}&fs_action_assignment=addnew&fs_tab_option_tasks=fs_assignment&pta_status=reject" method="POST"><input type="submit" class="vmc_list_option vmc_button_reject" value="Reject"></form></div>
	<div class="vmc_list_option_div"><form action="/admin/projects/projects/fs_projects.php?fs_tab=tasks&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_tasks&fs_action=view&fs_tab_tasks=assignment&task_id={$task_id}&assignment_id={$assignment_id}&fs_action_assignment=addnew&fs_tab_option_tasks=fs_assignment&pta_status=forward" method="POST"><input type="submit" class="vmc_list_option vmc_button_forward" value="Forward"></form></div>
</td>

HTML;
}

$object_ctl = "/admin/projects/projects/fs_projects.php?fs_tab=tasks&project_id={$_REQUEST["project_id"]}&fs_tab_option=fs_tasks&fs_action=view&";
$link_options = "&fs_action=view&fs_tab=tasks&project_id={$_REQUEST["project_id"]}";
$list_options = array ();

$_OBJECT_IFACE_LIST = _app_create_list_object (array (
                db_conn=>$_GLOBAL_DBH,
                indexes=>$indexes,
		list_count=>"SELECT COUNT(*) FROM project_task_assignment WHERE assigned_id={$_APP_SESSION_USER->id} AND status!='accept' AND close='false'",
		list_select=>"SELECT project_tasks.title,project_task_assignment.*,CONCAT(last,', ',first) AS assigning_user FROM project_task_assignment,project_tasks,users WHERE project_task_assignment.assigned_id={$_APP_SESSION_USER->id} AND project_task_assignment.status!='accept' AND close='false' AND project_task_assignment.user_id=users.id AND task_id=project_tasks.id",
                list_id=>"lc_project_task_tassigned",
		list_title=>"&nbsp;&raquo;&nbsp;Tasks Assigned",
                list_options=>$list_options,
                primary_key=>"id",
                primary_relation=>"task_id",
                link_options=>$link_options,
                object_ctl=>$object_ctl
));

$_OBJECT_IFACE_TABBING_PANEL->insert_container ($_OBJECT_IFACE_LIST);

?>
